angular
	.module('directives')
	.directive(
		'chart',
		function() {
		    return {
			restrict : 'E',
			template : '<div id="container" style="margin: 0 auto">not working</div>',
			replace : true,
			scope : {
			    chartData: "=value",
		            chartObj: "=?"
			},
			transclude: true,
			link : function($scope, $element, $attrs) {
			    $scope.$watch('chartData', function(value){
				 new Highcharts.Chart({
				     chart : {
					 renderTo : 'container'
				     },
				     title : {
					 text : 'Browser market shares at a specific website, 2010'
				     },
				     tooltip : {
    						// pointFormat : '{series.name}:<b>{point.percentage}%</b>',
    						// percentageDecimals : 1
				     },
				     series : $scope.chartData
				 });
			    });		   
			}
		    };
		});